package com.meme.editor.model.sprite2d;

import java.awt.Graphics2D;
import java.awt.Rectangle;

import org.apache.log4j.Logger;

import com.meme.editor.EntityObject;


import com.meme.editor.PropertyValueModification;
import com.meme.editor.PropertyValueModificationList;

import com.meme.editor.property.value.StringPropertyValue;

import com.meme.util.ObjectRef;

public abstract class Module extends EntityObject
{
	public static final int RenderFlag_HideImage        = 1 << 0;
	public static final int RenderFlag_ShowBox          = 1 << 1;
	public static final int RenderFlag_ShowUnionBox     = 1 << 2;
	public static final int RenderFlag_MaskImage        = 1 << 3;
	
	
	static Logger logger = Logger.getLogger (Module.class);
	

	public Module (String name)
	{
		this (name, null);
	}
	
	public Module (String name, EntityObject parent)
	{
		super (name, parent);
		
		// build property manager
	}
	

	@Override
	public String getDefaultName ()
	{
		return "Module";
	}
	
	
	
	@Override
	protected void _handleModifyingPropertyValues (PropertyValueModificationList modications)
	{
			
		super._handleModifyingPropertyValues (modications);
	}		
	
	

	public ModuleGroup getGroup ()
	{
		return (ModuleGroup) getParent ();
	}
	
	// to do
	public void moveToGroup (ModuleGroup group)
	{

	}
	
	abstract public int getMinX ();
//	abstract public int getMaxX ();
	abstract public int getMinY ();
//	abstract public int getMaxY ();
	abstract public int getWidth ();
	abstract public int getHeight ();
	
//	abstract public Rectangle getBounds ();
	
	abstract public boolean isImageHybird ();
	abstract public boolean isPaletteHybird ();
	
	// the prototype may be changed later
	abstract public void render (Graphics2D g, int posX, int posY, boolean flipX, boolean flipY, int scale, int flags);
	
}
